import pandas as pd

edges = pd.read_csv('./CS_edges.csv', usecols=[':START_ID', ':END_ID'])  # 明确指定需要读取的列
reverse_edges = edges.rename(columns={':START_ID': ':END_ID', ':END_ID': ':START_ID'})

all_edges = pd.concat([edges, reverse_edges], ignore_index=True)
all_edges = all_edges.drop_duplicates()
all_edges_sorted = all_edges.sort_values(by=[':START_ID', ':END_ID'])
all_edges_sorted.to_csv('./CS.ungraph', sep='\t', header=False, index=False)